Skip to content

feat: build full demo mode for the reference UI#216

Open
SharifIbrahimDev wants to merge 1 commit into
bridgelet-org:mainfrom
SharifIbrahimDev:experiment/demo-mode
Open

feat: build full demo mode for the reference UI#216
SharifIbrahimDev wants to merge 1 commit into
bridgelet-org:mainfrom
SharifIbrahimDev:experiment/demo-mode

Conversation

@SharifIbrahimDev

Copy link
Copy Markdown

Closes #100

What does this PR do?

This PR introduces a comprehensive Demo Mode for the Bridgelet Reference UI. By appending the ?demo=true query parameter to the application URL, the UI will intercept all backend SDK API calls and return mocked responses via MSW. This allows contributors, developers, and presenters to experience the complete send and claim flows locally without spinning up the backend services.

Description

  • MockProvider Update: Updated frontend/components/mock-provider.tsx and layout.tsx to conditionally initialize MSW if process.env.NODE_ENV === 'development' OR if the demo=true query parameter is detected.
  • API Mock Handlers: Created frontend/mocks/handlers/api.ts to mock the core API endpoints (/send, /claim/:token, and /claim/:token/redeem). The mocked responses simulate real-world delays and generate mock claim links containing the ?demo=true flag to persist the demo state across pages.
  • Send Flow Integration: Updated frontend/components/send-form/steps/confirm-step.tsx to call the real createPaymentIntent SDK method instead of using a placeholder timeout, enabling it to route directly into our new MSW handlers.
  • Documentation: Authored docs/demo-mode.md outlining how to use Demo Mode, its use-cases, and its limitations (e.g., ephemeral state memory).
  • TypeScript Fixes: Resolved previously undetected type errors in wallet.ts, bridgelet.ts, and browser.ts to ensure the frontend compiles without warnings.

Acceptance Criteria met

  • Implementation complete
  • Tests passing
  • Docs updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK wrapper: exponential backoff retry for transient errors

1 participant